package com.jjty.dataGenerator.data.service;

import com.jjty.dataGenerator.data.entity.OperationLog;
import com.jjty.dataGenerator.data.mapper.OperationLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class OperationLogService {

    @Autowired
    private OperationLogMapper operationLogMapper;

    public void saveLog(String operationType, String operationIp, String operationStatus,String dataType) {
        OperationLog operationLog = new OperationLog();
        operationLog.setOperationType(operationType);
        operationLog.setOperationIp(operationIp);
        operationLog.setOperationStatus(operationStatus);
        operationLog.setOperationDate(LocalDateTime.now());
        operationLog.setDataType(dataType);
        operationLogMapper.insert(operationLog);
    }
}